package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);not null;comment:用户名"`
	Avatar   string `gorm:"type:varchar(500);not null;comment:头像"`
	Mobile   string `gorm:"type:char(11);not null;comment:联系方式"`
	Password string `gorm:"type:varchar(50);not null;comment:密码"`
}
type Lesson struct {
	gorm.Model
	Info     string `gorm:"type:varchar(30);not null;comment:简介"`
	Area     string `gorm:"type:varchar(30);not null;comment:教学领域"`
	RealName string `gorm:"type:varchar(30);comment:真实姓名"`
	Picture  string `gorm:"type:varchar(500);not null;comment:照片"`
	IdCard   string `gorm:"type:char(18);comment:身份证号码"`
	UserId   int64  `gorm:"type:int;not null;comment:用户Id"`
	Title    string `gorm:"type:varchar(50);not null;comment:标题"`
	Price    int64  `gorm:"type:int;not null;comment:价格"`
}
type Comment struct {
	gorm.Model
	UserId   int64  `gorm:"type:int;not null;comment:用户Id"`
	lessonId int64  `gorm:"type:int;not null;comment:课程Id"`
	Content  string `gorm:"type:varchar(200);not null;comment:评论内容"`
}
type Collect struct {
	gorm.Model
	UserId   int64 `gorm:"type:int;not null;comment:用户Id"`
	LessonId int64 `gorm:"type:int;not null;comment:课程Id"`
}

type LessonData struct {
	Lesson
	Username string
	Avatar   string
}

type CollectData struct {
	Lesson
	Collect
	Username string
	Avatar   string
}
